Size Class
Description:
A class for creating Size objects.
__call
Type: Metamethod.
Description:
Create a new Size object with the given width and height.
Signature:
metamethod __call: function(
self: SizeClass,
width?: number --[[0]],
height?: number --[[0]]
): Size
Usage:
local size = Size(10, 20)
Parameters:
Parameter | Type | Description |
---|---|---|
width | number | [optional] The width of the new size (default 0). |
height | number | [optional] The height of the new size (default 0). |
Returns:
Return Type | Description |
---|---|
Size | The new Size object. |
__call
Type: Metamethod.
Description:
Create a new Size object from an existing Size object.
Signature:
metamethod __call: function(self: SizeClass, other: Size): Size
Usage:
local newSize = Size(existingSize)
Parameters:
Parameter | Type | Description |
---|---|---|
other | Size | The existing Size object to create the new object from. |
Returns:
Return Type | Description |
---|---|
Size | The new Size object. |
__call
Type: Metamethod.
Description:
Create a new Size object from a Vec2 object.
Signature:
metamethod __call: function(self: SizeClass, vec: Vec2): Size
Usage:
local size = Size(Vec2(10, 20))
Parameters:
Parameter | Type | Description |
---|---|---|
vec | Vec2 | The vector to create the new size from, represented by a Vec2 object. |
Returns:
Return Type | Description |
---|---|
Size | The new Size object. |
zero
Type: Readonly Field.
Description:
Gets zero-size object.
Signature:
const zero: Size